package Day06;

import java.util.Arrays;

public class MaxOfArray {
    public static void main(String[] args) {
        int [] arr5=new int[10];int max = arr5[0];
        for (int i=0;i< arr5.length;i++){
            arr5[i]=(int)(Math.random()*99);
            System.out.println(arr5[i]);
            }
        for (int i=0;i<arr5.length;i++){
            if (arr5[i]>max){
                max = arr5[i];
            }
        }
        arr5=Arrays.copyOf(arr5,arr5.length+1);
        arr5[arr5.length-1]=max;
        System.out.println(Arrays.toString(arr5));
    }
}
